Model structure definition¶
Overview¶
When defining a metamodel, the first thing to do is to define the structure of the model. Next Design allows you to define the structure of your model in the form of UML class diagrams. You can define the structure of a model by defining entities and interactions that represent design items and their parent-child relationships in the metamodel using class diagrams.
Entity is a model of a model. In object-oriented design, entities are classes and models are instances. Interaction is a model of a model that represents the interaction (behavior) between models. UML sequence diagram can be expressed by interaction.
The steps below define the model structure in the class diagram, in the following order:
- Prepare class diagram for structure definition
- Add entity
- Delete entity
- Change settings for each entity
- Define entity hierarchy
- Add/remove interactions
- Classify by package and define
Image of model structure definition by class diagram
Prepare class diagram for structure definition¶
Switch to the metamodel edit screen¶
To start defining the metamodel, first switch to the metamodel edit screen. The procedure is as follows.
Operating procedure
- Switch to Profile Navigator with the selector at the top of the Navigator.
Add class diagram to metamodel¶
To add a class diagram to your metamodel, use the Profile Navigator to do the following:
Operating procedure
- Right-click the root node displayed at the top in the profile navigator or the package created in the profile, and execute [Add Class Diagram] from the context menu.
- Enter the name of the added class diagram. The added class diagram will be displayed in the center of the screen and can be edited.
Hint
- You can create multiple class diagrams in the metamodel. You can define a class diagram separately for each type of model, or you can define a detailed class diagram by cutting out parts such as the overall view and detailed view.
Add an entity¶
There are multiple ways to add an entity:
- Add a new entity to the metamodel
- Add existing entity to class diagram (redisplay entities not in class diagram)
- Add new entity while modeling (change metamodel at the same time in model edit screen)
Add a new entity to the metamodel¶
To add a new entity to the metamodel using the class diagram, drag and drop Entity from the class toolbox and add a name.
Add existing entity to class diagram¶
To add an entity already defined in the metamodel to the class diagram for display, do the following:
Operating procedure
- Add the defined entities displayed in the Profile Navigator by dragging and dropping them into the class diagram.
Add a new entity while modeling¶
While modeling on the model edit screen, you can also add undefined entities to the metamodel one after another and proceed with modeling. The procedure is as follows.
Operating procedure
- Right-click the parent model in the model navigator and select Add Model> New Entity from the context menu.
- Enter the required information in the [New Entity] dialog and click the [OK] button.
- By the above operation, a new entity is added to the metamodel and at the same time, a model with the same display name as the entity is added to the model navigator.
Note
- New entities added to the metamodel will be visible in the profile navigator but not automatically in the class diagram. If necessary, manually add it to the class diagram as described in "Adding an existing entity to the class diagram" above.
Define entity hierarchy¶
To specify the hierarchical structure of the model in the metamodel, an ownership relationship is established between the entities that are the parent-child relationship. The procedure is as follows.
Operating procedure
- Move the pointer to the parent entity in the class diagram, drag the [▲] icon displayed in the four directions, and drop it on the child entity.
- When you drop it, the relevant type of choice pops up. Click [Embedded] from among them to select it.
- This defines the parent-child relationship between the entities and allows you to add child entities as part of the parent entity during modeling.
Info
- You can define an entity with a nested structure by specifying the same entity as the reference source as the reference destination.
Change settings for each entity¶
To change the entity icon or change the entity handling to an abstract class, select the target entity in the class diagram or profile navigator and then use the inspector.
Reference
- For details on the setting items for the entity, refer to Reference> Profile setting items and modeling changes.
Using custom icons
- In addition to the standard built-in icons, you can also use your own icon.
- For more information, see FAQ>I want to use my own icon instead of the built-in icon.
Delete entity¶
There are multiple ways to delete an entity:
- Remove entity from metamodel
- Delete the entity from the class diagram (hide it in the class diagram without deleting it from the metamodel)
remove entities from the metamodel¶
To remove an entity from the metamodel using a class diagram:
Operating procedure
- Select the target entity in the class diagram and execute [Delete From Model] from the context menu.
- If there are models or other related entities that reference the entity, a warning message will be displayed. If you want to delete those models and their relations, click the corresponding button to proceed.
- This will remove the target entity from the class diagram as well as from the metamodel, and will also remove the target entity from the Profile Navigator.
attention
- When the target entity is selected and the Del key is pressed, it is only deleted from the class diagram like [Delete From Diagram] of the context menu, not deleted from the metamodel, and is displayed on the profile navigator. Will remain.
You can also remove an entity from the metamodel using the following steps.
Other operating procedures
- Select the target entity in the profile navigator and execute [Delete] from the context menu, or press the Del key.
remove entities from class diagram¶
To remove an entity from the class diagram to make it invisible:
Operating procedure
- Select the target entity in the class diagram and execute [Delete From Diagram] from the context menu, or press the Del key.
- This removes it from the class diagram but not from the metamodel and leaves the target entity on the Profile Navigator. To redisplay it in the class diagram, manually add it to the class diagram by following the steps in "Add an existing entity to the class diagram" above.
Add/remove interactions¶
To add a new interaction to the metamodel, add an Interaction by dragging and dropping it from the Class Toolbox, and enter a name, similar to adding an entity.
Reference
- See "Adding Entities" above for information on adding entities.
To delete an interaction from the metamodel, delete the interaction as you would delete an entity.
Reference
- To delete an entity, see "Delete an entity" above.
Classify and define each package¶
To categorize metamodel definitions by model type or according to the design process, add packages to the metamodel to categorize the metamodel components. The procedure is as follows.
Operating procedure
- Right-click the root node displayed at the top of the profile navigator or the package created in the profile, and select [Add]> [Package] from the context menu.
- Execute [Rename] from the context menu of the added package, or press the F2 key and enter the package name.
- After adding the package, drag and drop existing components into the package on the Profile Navigator to move them.